﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DaInterFace
{
    public interface IDataBase
    {
        event DataBaseMessage MessageEvent;
        String GetConnection();
        Boolean Test();
        Recordset ExeBase(String sql);
        Recordset ExeBase(String sql, SqlParameter[] parameters);
        Recordset ExeProcedure(String baseNo, String sql);
        Recordset ExeProcedure(String baseNo, String sql, SqlParameter[] parameters);


        MeterInfoObject GetMeterInfoByCardSerial(String serial);

        Dictionary<String, SetOfBook> GetAccounts();
        void Message(MessageType type, String note);
        Dictionary<string, SalesAccount> ExeSalesAccount(String accountid, String strAccountISN);
    }

    public class Recordset
    {
        public Boolean Enable;
        public DataSet Data;
        public Double Usetime;
        public String Message;
    }
    


    public delegate void DataBaseMessage(MessageType type, String note, Double span);
}
